package vg.services.graph_view_manager.interfaces.graph_comparison;

import vg.services.graph_view_manager.interfaces.graph_view.AGraphView;
import vg.services.graph_view_manager.interfaces.tab.ATab;

/**
 * Interface for graph comparison.
 * @author Timur Zolotuhin (e-mail: tzolotuhin@gmail.com)
 */
public abstract class AGraphComparisonView extends ATab {
    // shows graph intersection, first graph and second graph on one view. But selects graph intersection.
    public static final int SHOW_GRAPH_INTERSECTION = 4;

    // shows graph intersection, first graph and second graph on one view. But selects first graph.
    public static final int SHOW_FIRST_GRAPH = 5;

    // shows graph intersection, first graph and second graph on one view. But selects second graph.
    public static final int SHOW_SECOND_GRAPH = 6;

    /**
     * Constructor.
     */
    public AGraphComparisonView() {
		super(ATab.DEF_GRAPH_COMPARISON_TAB_TYPE);
	}

    /**
     * This method compares of two graphs.
     */
    public abstract boolean compare(IGraphComparisonAlgorithmObserver observer);

    /**
     * This method stops current comparison.
     */
    public abstract void stopComparison();

    /**
     * This method returns status of graph comparison components.
     */
    public abstract boolean isStartComparisonProcess();

    /**
     * This method gets current input properties for comparison algorithm.
     */
    public abstract InputGraphComparisonAlgorithmProperties getCurrentInputGraphComparisonAlgorithmProperties();

    /**
     * This method sets input properties for comparison algorithm.
     */
    public abstract boolean setInputGraphComparisonAlgorithmProperties(InputGraphComparisonAlgorithmProperties properties);

    /**
     * This method returns current output properties, which were got after last comparison
     */
    public abstract OutputGraphComparisonAlgorithmProperties getOutputGraphComparisonAlgorithmProperties();

    /**
     * This method estimates some output properties in dependencies from input properties.
     */
    public abstract OutputGraphComparisonAlgorithmProperties estimate(InputGraphComparisonAlgorithmProperties properties);

    /**
     * This method selects one of parts.
     * @param part - one of next value: SHOW_FIRST_GRAPH_ONLY, SHOW_SECOND_GRAPH_ONLY, SHOW_GRAPH_INTERSECTION_ONLY,
     *               SHOW_GRAPH_INTERSECTION, SHOW_FIRST_GRAPH, SHOW_SECOND_GRAPH.
     */
    public abstract boolean show(int part);

    /**
     * Returns result of graph comparison, how graph view.
     */
    public abstract AGraphView getMainGraphView();
}
